package com.zlq.service;

import com.zlq.dao.UserDao;
import com.zlq.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public boolean login(User user){
        //boolean a = true;
        String username = user.getUsername();
        String password = user.getPassword();
        User user1 = userDao.queryUser(username);
        System.out.println("-----------userService-----------");
        System.out.println(user1.getUsername());
        System.out.println(user1.getPassword());
        if(user1.getPassword().equals(password)){
            return true;
        }
        return false;
    }

}
